package com.tdkj.model.user;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.tdkj.model.base.BaseEntity;

/**
 * XnkyUserLevel entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "xnky_user_level")
public class BeanUserLevel extends BaseEntity {

	private static final long serialVersionUID = 8184337173000198598L;
	// Fields
	private String levelname;

	private int startnumber;
	private int endnumber;
	private Timestamp createtime;
	private String levelcode;
	private Set<BeanUserIntegral> userIntegrals = new HashSet<BeanUserIntegral>(
			0);
	private Set<BeanUser> users = new HashSet<BeanUser>(0);

	private BeanUserExperiences beanUserExperiences;

	public String getLevelname() {
		return levelname;
	}

	public void setLevelname(String levelname) {
		this.levelname = levelname;
	}

	/** default constructor */
	public BeanUserLevel() {
	}

	/** minimal constructor */
	public BeanUserLevel(long id) {
		this.setId(id);
	}
	@Column(name = "startnumber")
	public int getStartnumber() {
		return startnumber;
	}

	public void setStartnumber(int startnumber) {
		this.startnumber = startnumber;
	}
	@Column(name = "endnumber")
	public int getEndnumber() {
		return endnumber;
	}

	public void setEndnumber(int endnumber) {
		this.endnumber = endnumber;
	}

	@Column(name = "createtime", length = 19)
	public Timestamp getCreatetime() {
		return this.createtime;
	}

	public void setCreatetime(Timestamp createtime) {
		this.createtime = createtime;
	}

	@Column(name = "levelcode", length = 40)
	public String getLevelcode() {
		return this.levelcode;
	}

	public void setLevelcode(String levelcode) {
		this.levelcode = levelcode;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "userLevel")
	public Set<BeanUser> getUsers() {
		return this.users;
	}

	public void setUsers(Set<BeanUser> users) {
		this.users = users;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "userLevel")
	public Set<BeanUserIntegral> getUserIntegrals() {
		return this.userIntegrals;
	}

	public void setUserIntegrals(Set<BeanUserIntegral> userIntegrals) {
		this.userIntegrals = userIntegrals;
	}

	@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	public BeanUserExperiences getBeanUserExperiences() {
		return beanUserExperiences;
	}

	public void setBeanUserExperiences(BeanUserExperiences beanUserExperiences) {
		this.beanUserExperiences = beanUserExperiences;
	}
}